{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "111c42ff",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n"
     ]
    }
   ],
   "source": [
    "for i in range(5):\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0e809731",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[5, 6, 7, 8, 9]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(5,10))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "0bd450f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 3, 6, 9]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(0,10,3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "464925de",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[-10, -40, -70]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(-10,-100,-30))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ab524bbe",
   "metadata": {},
   "source": [
    "## 2.变量（数字，字符串，对象）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "92870573",
   "metadata": {},
   "source": [
    "1.数字（numbers)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "176d247b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.6"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> 2 + 2\n",
    "4\n",
    ">>> 50 - 5*6\n",
    "20\n",
    ">>> (50 - 5*6) / 4\n",
    "5.0\n",
    ">>> 8 / 5  # division always returns a floating point number\n",
    "1.6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "93beb1f5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "17"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> 17 / 3  # classic division returns a float\n",
    "5.666666666666667\n",
    ">>>\n",
    ">>> 17 // 3  # floor division discards the fractional part\n",
    "5\n",
    ">>> 17 % 3  # the % operator returns the remainder of the division\n",
    "2\n",
    ">>> 5 * 3 + 2  # result * divisor + remainder\n",
    "17"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "acd0b11e",
   "metadata": {},
   "source": [
    "2.字符串(strings)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2a6e12bf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\"Isn\\'t,\" they said.'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    ">>> 'spam eggs'  # single quotes\n",
    "'spam eggs'\n",
    ">>> 'doesn\\'t'  # use \\' to escape the single quote...\n",
    "\"doesn't\"\n",
    ">>> \"doesn't\"  # ...or use double quotes instead\n",
    "\"doesn't\"\n",
    ">>> '\"Yes,\" they said.'\n",
    "'\"Yes,\" they said.'\n",
    ">>> \"\\\"Yes,\\\" they said.\"\n",
    "'\"Yes,\" they said.'\n",
    ">>> '\"Isn\\'t,\" they said.'\n",
    "'\"Isn\\'t,\" they said.'"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7399b5db",
   "metadata": {},
   "source": [
    "3.对象(一切皆是对象everything is an object)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
